<template>
	<div id="app">
		PM25的值：<input type="text" v-model="pm25" />
		<img :src="theImg">
	</div>
</template>

<script>
	export default {
		data() {
			return {
				pm25: 180,
			}
		},
		// 计算属性
		computed: {
			theImg() {
				if (this.pm25 < 100) return "../img/1.png"
				else if (this.pm25 < 200) return "../img/2.png"
				else if (this.pm25 < 300) return "../img/3.png"
				else return "../img/4.png"
			},
		},
	}
</script>

<style>
</style>